package com.ganyu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ganyu.domain.dto.UpdateAdminArticleDto;
import com.ganyu.domain.entity.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    //根据id修改浏览量
    boolean UpdateViewCount(@Param("id") Long id, @Param("viewCount") Long viewCount);
    //文章模糊查询
    List<Article> getArticleFuzzy(@Param("num") Integer num,@Param("pageSize")Integer pageSize,@Param("title")String title,@Param("summary")String summary);
    //文章模糊查询个数
    int getArticleFuzzyNum(@Param("title")String title,@Param("summary")String summary);

    //修改文章内容
    void updateArticle(UpdateAdminArticleDto updateAdminArticleDto);

    //获取文章数量
    int selectArticleCount();
    //删除文章
    void deleteArticleById(@Param("ids") Long[] ids);
}
